package itbour.onetouchshow.utils.video;

import android.content.Context;

import java.lang.reflect.Field;

/**
 * Created by guoh on 2018/6/20.
 * 功能描述：
 * 需要的参数：
 */
public class StatusBarUtils {

    public static int getStatusBarHeight(Context context) {
        int statusBarHeight = 0;
        try {
            Class<?> c = Class.forName("com.android.internal.R$dimen");
            Object obj = c.newInstance();
            Field field = c.getField("status_bar_height");
            int x = Integer.parseInt(field.get(obj).toString());
            statusBarHeight = context.getResources().getDimensionPixelSize(x);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return statusBarHeight;
    }
}
